﻿
@{
    ViewBag.Title = "UserList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="SafetyCardController" ng-init="page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
         SearchModel={};
        BindDepartmentList('Dep_Select');
         GetEmployeePageList(SearchModel,page);">
    <div class="load" ng-show="PageLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg">{{LoadingMsg}}</div>
        </div>
    </div>
    <div class="page-heading">
        <h1>员工列表</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>教育培训</a></li>
        <li><a>安全生产记录</a></li>
        <li class="active"><a>员工列表</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading"><h2>过滤</h2></div>
                    <div class="panel-body">
                        <form class="form-horizontal">
                            <div class="form-group">
                                <div class="col-md-2">
                                    <input type="text" class="form-control" placeholder="工号/姓名" ng-model="SearchModel.EmployeeNameOrNo"  />
                                </div>
                                <label class="col-sm-1 control-label">所在部门：</label>
                                <div class="col-sm-2">
                                    <select id="Dep_Select" class="selectpicker show-tick form-control" ng-model="SearchModel.DepartmentId" data-live-search="true">
                                        <option value="" selected>所有部门</option>
                                    </select>
                                </div>
                                <div class="col-sm-1">
                                   <button class="btn btn-primary" ng-click="GetEmployeePageList(SearchModel,1);">查询</button>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-sky">
                    <div class="panel-heading">
                        <h2>员工列表</h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                            
                            </div>
                        </div>
                    </div>
                    <div class="panel-body  panel-no-padding">
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered" ng-show="!PageLoading">
                            <thead>
                                <tr>
                                    <th style="width:3%">序号</th>
                                    <th style="width:5%">工号</th>
                                    <th style="width:10%">姓名</th>
                                    <th style="width:10%">部门</th>
                                    <th style="width:15%">联系方式</th>
                                    <th style="width:15%">邮箱</th>
                                    <th style="width:20%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="DataList==null || DataList.length==0">
                                    <td colspan="8" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr ng-repeat="x in DataList" ng-show="DataList!=null && DataList.length>0">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="x.EmployeeNo"></td>
                                    <td ng-bind="x.EmployeeName"></td>
                                    <td ng-bind="x.DepartmentName"></td>
                                    <td ng-bind="x.Phone"></td>
                                    <td ng-bind="x.Email"></td>
                                    <td>
                                        <a class="btn btn-success btn-xs btn-label" ng-href="EmployeeDetailRecord?EmployeeNo={{x.EmployeeNo}}&Id={{x.Id}}&page={{result.currentPage}}"><i class="fa fa-list"></i>安全生产记录</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="text-center" ng-show="DataList!=null && DataList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetEmployeePageList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetEmployeePageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetEmployeePageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetEmployeePageList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

@section Js{
    <script src="~/Assets/js/pg/SafetyCard.js"></script>
}

